#include "skill.h"

skill::skill()
{
    //



    //1
    load1=0;
    skill1=false;
    lasttime1=400;


    //2

    skill2=false;
     load2=0;
    daodan.load(":/picture/bullet2.png");
     m_x=0;
     m_y=0;
     free=true;
     m_rect.setWidth(daodan.width());
     m_rect.setHeight(daodan.height());
     m_rect.moveTo(m_x,m_y);
     lasttime2=400;

     //
     skill3=false;
     load3=0;

     //
     skill4=false;
     load4=0;


}

void skill::updatestatu1()
{
    load1++;
    if(load1>=100)
    {
        load1=100;
        skill1=true;
    }

}

void skill::updatestatu2()
{
    load2++;
    if(load2>=100)
    {
        load2=100;
        skill2=true;
    }
}

void skill::updatepositions2()
{
    if(free==true)
    {
        return;
    }
    else
    {
        m_y-=8;
        m_rect.moveTo(m_x,m_y);
    }
    if(m_y<=-m_rect.height())
    {
        free=true;
    }

}

void skill::updatestatu3()
{
    load3++;
    if(load3>=100)
    {
        load3=100;
        skill3=true;
    }
}

void skill::updatestatu4()
{
    load4++;
    if(load4>=100)
    {
        load4=100;
        skill4=true;
    }
}
